<template>
    <div class="income-template">
        <yd-navbar slot="navbar" title="股东信息" class="public-header">
            <span slot="left">
                <a href="javascript:window.history.go(-1)"><yd-navbar-back-icon></yd-navbar-back-icon></a>
            </span>
        </yd-navbar>
        <yd-slider autoplay="3000">
            <yd-slider-item v-for="item in data.detail_pic">
                <a href="javascript:;">
                    <img :src="item.image">
                </a>
            </yd-slider-item>
        </yd-slider>
        <div class="income-content">
            <h3 class="income-title">股东列表 [ 店铺：{{data.shop_name}} ] </h3>
        </div>
        <yd-list theme="1">
            <yd-list-item v-for="item in data.data">
                <img slot="img" :src="item.avatar.image">
                <span slot="title">{{item.name}}   持股比例{{item.stock_right_percent}}%</span>
                <yd-list-other slot="other">
                    <div>
                        <p>联系电话{{item.phone}}</p>
                    </div>
                </yd-list-other>
            </yd-list-item>
        </yd-list>
        <yd-tabbar slot="tabbar" class="public-footer">
            <yd-tabbar-item title="首页" link="/">
                <yd-icon name="home" slot="icon"></yd-icon>
            </yd-tabbar-item>
            <yd-tabbar-item title="投资收益" link="/income" active>
                <yd-icon name="shopcart-outline" slot="icon"></yd-icon>
            </yd-tabbar-item>
            <yd-tabbar-item title="信息交流" link="/message">
                <yd-icon name="like-outline" slot="icon"></yd-icon>
            </yd-tabbar-item>
            <yd-tabbar-item title="个人中心" link="/user">
                <yd-icon name="ucenter-outline" slot="icon"></yd-icon>
            </yd-tabbar-item>
        </yd-tabbar>
    </div>
</template>
<script>
    import Ajax from "../api/ajax.js"
    import dataURL from "../data/dataURL.js"
    export default {
        data() {
            return {
                queryID: '',
                data: {
                    cover_pic: [],
                    intro: "",
                    shop_name: "",
                    loadBloean:true,
                    data: [{
                        avatar: {
                            image: "",
                            image_path: "",
                        },
                        created_at: "1494236644",
                        name: "zxhuan",
                        phone: "13531408911",
                        price: "20.00",
                        shop_id: "8",
                        stock_right_percent: "20.00",
                        updated_at: "1494236644",
                        user_id: 9,
                    }]
                }
            }
        },
        methods: {
            async getData() {
                this.queryID = this.$route.query.id;
                let res = await Ajax.Post(dataURL.income.holderList, {
                    shop_id: this.queryID
                });
                this.data = res;
                console.log(res);
                this.loadBloean = false;

            }
        },
        computed: {
            showLoading() {
                if (this.loadBloean) {
                    this.$dialog.loading.open('很快加载好了');
                } else {
                    this.$dialog.loading.close();
                }
            }
        },
        mounted() {
            this.getData();
        }

    }

</script>